<?php
require_once $_site->get_viewpath("mobile/common/authcheck");
require_once $_site->get_viewpath("mobile/common/header");

$id=request('id',false,true);
if(!$id)return false;

//查询管理员信息
$admin_objet=new manager();
$pid=$admin_objet->admin_project_id();

$info=$admin_objet->record_info($id,$pid);

//绑定信息
$binfo=$admin_objet->bind_info($info['did'],'phone');
//项目名称
$pinfo=$admin_objet->project_info($info['pid'],'title');
//项目经理账号
$admininfo=$admin_objet->projecter_info($info['xid'],'name');

$truckType=array('a'=>'A 型','b'=>'B 型','c'=>'C 型');
$dustType=array('1'=>'Ⅰ类','2'=>'Ⅱ类','3'=>'Ⅲ 类');
$onloadType=array(1=>"空车",2=>"重车");
$stateType=array(1=>"有效",0=>"无效");
$typeAry=array(1=>'挖机装车 ',2=>'挖机计时',3=>'渣车登记');

$record = $admin_objet->record_time_group($info['pid'], $info['did'], $info['group']);
$record_count = count($record);
?>	
</head>

	<body>
		<div class="headertwo clearfloat" id="header">
			<a href="javascript:history.go(-1)" class="fl box-s"><i class="iconfont icon-arrow-l fl"></i></a>
			<p class="fl">记录详情</p>			
			<a href="/mobile/center" class="fr"><i class="iconfont icon-gerenzhongxin fl"></i></a>
		</div>
		
		<!--分享内容-->		
		<div class="clearfloat" id="main">		
			
			<div class="service-top clearfloat box-s">			
				<div class="left fl clearfloat box-s">
					<p class="tit titwo"><?php echo $info['doper']?><span><?php echo $binfo['phone']?'('.$binfo['phone'].')':'';?></span></p>
					<p class="fu-tit"><?php echo '车型:'.$info['car_type'].' | 车牌: '.$info['dname'] ?></p>
				</div>
				<div class="right fl clearfloat">
				    <?php 
				        if($binfo){
				    ?>
				    <a href="tel:<?php echo $binfo['phone'];?>">
					<i class="mui-icon mui-icon-phone"></i>
					<p>拨打</p>
                    </a>						
					<?php 
					    }else{
					?>
					<i class="iconfont icon-gerenzhongxin"></i>
					<p>师傅</p>					
					<?php 
					    }
					?>
				</div>
			</div>
			
			<div class="service-ctent clearfloat">
				<div class="recom-tit clearfloat box-s">
		    		<p>记录信息</p>
		    	</div>
		    	<div class="service-list clearfloat box-s">
		    		<ul>
		    			<li>类型：<?php echo $typeAry[$info['type']];?></li>
		    			<li>设备号：<?php echo $info['dno']?></li>
		    			<li>产权人：<?php echo $info['downer']?></li>		    			
		    			<li>时间：<?php echo ($record_count-1)*3;?> 分钟</li>
		    			<li>项目名称：<?php echo $pinfo['title'];?></li>
		    			<li>项目经理：<?php echo $admininfo['name'];?></li>		    		
		    		</ul>		    		
		    	</div>		    	
			</div>
			
			<div class="service-ctent clearfloat">
				<div class="recom-tit clearfloat box-s">
		    		<p>记录照片  (<?php echo $record_count;?>张)
		    		<a href="javascript:;" onclick="confirmreload('是否重新加载该页面 ?');" style="color:#333333;font-size:.45rem;margin-right:20px;" class="fr">点击刷新</a>
		    		</p>		    				    	
		    	</div>
		    	<div class="recom-xia clearfloat box-s">
		    	    <?php 
		    	       if($record){
                          foreach($record as $vo){
		    	    ?>
		    		<div class="list clearfloat fl">		    			
			    			<div class="tu">
			    				<span></span>
			    				<img class="mui-media-object mui-pull-left" data-lazyload="<?php echo $vo['img'];?>"/>
			    			</div>
			    			<p><?php echo date('Y-m-d H:i:s',$vo['ctime'])?></p>		    			
		    		</div>
                    <?php }} ?> 
		    	</div>

		</div>
			
	</body>
	<script type="text/javascript" src="/static/mobile/js/mui.lazyload.js"></script>	
	<script type="text/javascript" src="/static/mobile/js/mui.lazyload.img.js"></script>        
	<script>
		mui.init();
		(function($) {			
			$(document).imageLazyload({
				placeholder: '/static/mobile/images/loading.gif'
			});			
		})(mui);
	</script>		
	
</html>